# 生产线号	          1#	       2#	           3#	         4#	             5#	           6#
# 平均日生产量（个）	约55个	      约23个	          约35个	        约69个	        约16个  	      约42个
# 生产线类型	       异型构件	  异型构件、 叠合板 	  叠合板	      异型构件、叠合板     异型构件	     异型构件
#                   叠合板      内墙、  外墙       内墙、外墙      内墙、外墙          叠合板          叠合板


# 构件数据集（型号）(项目区别、楼层区别、其他)，（编号形式：PC_项目_楼栋_楼层____
# 两个项目（A,B），各两个楼栋（1#，2#），各三层（1f，2f）（进度A项目）
import X_Parameter as Parameter
Component_type = {
    'PCT_0_01': {
        'Process_Alias': ['模台清理', '模具安装', '布料振捣', '抹平压板', '养护', '质检修补'],
        'Process_Time': [[2, 2, 2, 2, 2, 2], [8, 9, 9, 7, 10, 6], [3, 4,3,3,4,3], [4,5,4,4,6,4], [8,9,8,8,10,8], [3,3,3,3,3,3]],
        'Process_Code': ['PC01', 'PC02', 'PC03', 'PC4', 'PC05', 'PC06'],
        'Mould': ['null', 'PC_0_01', 'PC_0_01', 'PC_0_01', 'PC_0_01', 'null'],
        'Worker': ['Worker01', 'Worker01', 'Worker02', 'Worker02', 'null', 'Worker03'],
        'Component_Detail': ['长内墙_型号1'],
    },
    'PCT_0_02': {
        'Process_Time': [[2, 2, 2, 2, 2, 2], [6, 7, 7, 6, 9, 6], [4,5,4,4,6,4], [3,5,3,3,6,3], [8,8,8,8,8,8], [2,2,2,2,2,2]],
        'Process_Code': ['PC01', 'PC02', 'PC03', 'PC4', 'PC05', 'PC06'],
        'Process_Alias': ['模台清理', '模具安装', '布料振捣', '抹平压板', '养护', '质检修补'],
        'Mould': ['null', 'PC_0_01', 'PC_0_01', 'PC_0_01', 'PC_0_01', 'null'],
        'Worker': ['Worker01', 'Worker01', 'Worker02', 'Worker02', 'null', 'Worker03'],
        'Component_Detail': ['短内墙_型号2'],
    },
    'PCT_0_03': {
        'Process_Time': [[2, 2, 2, 2, 2, 2], [3, 4, 4, 3, 5, 3], [2,3,2,2,4,2], [3,5,3,3,5,3], [7,7,7,7,7,7], [2,2,2,2,2,2]],
        'Process_Code': ['PC01', 'PC02', 'PC03', 'PC04', 'PC05', 'PC06'],
        'Process_Alias': ['模台清理', '模具安装', '布料振捣', '抹平压板', '养护', '质检修补'],
        'Mould': ['null', 'PC_0_02', 'PC_0_02', 'PC_0_02', 'PC_0_02', 'null'],
        'Worker': ['Worker01', 'Worker01', 'Worker02', 'Worker02', 'null', 'Worker03'],
        'Component_Detail': ['短外墙_型号3'],
    },
    'PCT_0_04': {
        'Process_Alias': ['模台清理', '模具安装', '布料振捣', '抹平压板', '养护', '质检修补'],
        'Process_Time': [[2, 2, 2, 2, 2, 2], [8, 9, 9, 7, 10, 6], [3, 4,3,3,4,3], [4,5,4,4,6,4], [8,9,8,8,10,8], [3,3,3,3,3,3]],
        'Process_Code': ['PC01', 'PC02', 'PC03', 'PC4', 'PC05', 'PC06'],
        'Mould': ['null', 'PC_0_01', 'PC_0_01', 'PC_0_01', 'PC_0_01', 'null'],
        'Worker': ['Worker01', 'Worker01', 'Worker02', 'Worker02', 'null', 'Worker03'],
        'Component_Detail': ['长外墙_型号4'],
    },
    'PCT_0_05': {
        'Process_Time': [[2, 2, 2, 2, 2, 2], [6, 7, 7, 6, 9, 6], [4,5,4,4,6,4], [3,5,3,3,6,3], [8,8,8,8,8,8], [2,2,2,2,2,2]],
        'Process_Code': ['PC01', 'PC02', 'PC03', 'PC4', 'PC05', 'PC06'],
        'Process_Alias': ['模台清理', '模具安装', '布料振捣', '抹平压板', '养护', '质检修补'],
        'Mould': ['null', 'PC_0_01', 'PC_0_01', 'PC_0_01', 'PC_0_01', 'null'],
        'Worker': ['Worker01', 'Worker01', 'Worker02', 'Worker02', 'null', 'Worker03'],
        'Component_Detail': ['叠合板_型号2'],
    },
    'PCT_0_06': {
        'Process_Time': [[2, 2, 2, 2, 2, 2], [3, 4, 4, 3, 5, 3], [2,3,2,2,4,2], [3,5,3,3,5,3], [7,7,7,7,7,7], [2,2,2,2,2,2]],
        'Process_Code': ['PC01', 'PC02', 'PC03', 'PC04', 'PC05', 'PC06'],
        'Process_Alias': ['模台清理', '模具安装', '布料振捣', '抹平压板', '养护', '质检修补'],
        'Mould': ['null', 'PC_0_02', 'PC_0_02', 'PC_0_02', 'PC_0_02', 'null'],
        'Worker': ['Worker01', 'Worker01', 'Worker02', 'Worker02', 'null', 'Worker03'],
        'Component_Detail': ['楼梯_型号3'],
    },
    'PCT_0_07': {
        'Process_Time': [[2, 2, 2, 2, 2, 2], [7, 8, 6, 7, 10, 5], [5,5,6,4,7,5], [3,6,3,4,6,4], [8,7,8,8,7,8], [2,3,2,3,2,3]],
        'Process_Code': ['PC01', 'PC02', 'PC03', 'PC04', 'PC05', 'PC06'],
        'Process_Alias': ['模台清理', '模具安装', '布料振捣', '抹平压板', '养护', '质检修补'],
        'Mould': ['null', 'PC_0_02', 'PC_0_02', 'PC_0_02', 'PC_0_02', 'null'],
        'Worker': ['Worker01', 'Worker01', 'Worker02', 'Worker02', 'null', 'Worker03'],
        'Component_Detail': ['异性构件_型号7'],
    }
}
# 资源数据集（型号）
Resource = {
    # 生产线数据集（剩余产能）
    'Line': {
        'Code': ['1#', '2#', '3#', '4#', '5#', '6#'],
        'Alias': ['外墙', '内墙、叠合板', '异型构件', '混合生产线', '异构生产线', '叠合板生产线'],
        'Open': Parameter.Line_Open,  # 生产线资源约束，(可使用)。开放数量(个产线仅一条：1：开放，0：未开放)
        'Cost': [300, 240, 280, 450, 260, 340],
    },
    # 1#工位数据集
    '1#': {
        'PL': '1#',
        'GW_Code': ['GW1', 'GW2', 'GW3', 'GW4', 'GW5', 'GW6'],
        'PL_Alias': ['模台清理', '模具安装', '布料振捣', '抹平压板', '养护', '质检修补'],
    },
    # 模具数据集
    'Mould': {
        'Code': ['PC_0_01', 'PC_0_02', 'PC_0_03'],
        'Alias': ['模具_内墙_型号1', '模具_内墙_型号2', '模具_内墙_型号3'],
        'Number': Parameter.Mould_Amount,  # 模具个数
        'Cost': [50, 84, 93]
    },
    # 工人数据集
    'Worker': {
        'Code': ['Worker01', 'Worker02', 'Worker03'],
        'Alias': ['模具工人', '混凝土工人', '质检工人'],
        'Number':  Parameter.Worker_Amount,  # 工人个数
        'Cost': [20, 35, 80]
    }
}
# 订单数据格式：构件编号：构件型号
Order = Parameter.Order


Global_Index = {
    'Mould_Index': {'null': -1, 'PC_0_01': 0, 'PC_0_02': 1, 'PC_0_03': 2},
    'Worker_Index': {'null': -1, 'Worker01': 0, 'Worker02': 1, 'Worker03': 2},
    'PC_Index': {'PC_0_01': 0, 'PC_0_02': 1, 'PC_0_03': 2},
    'PL_Index': {'1#': 0, '2#': 1, '3#': 2, '4#': 3, '5#': 4, '6#': 5}
}

##############################################################################################################################

##############################################################################################################################
# 生产线
Production_Line = [
    '1#', '2#', '3#', '4#', '5#', '6#'
]

# 构件类型
Production_class = [
    '1：模台清理', '2：模具安装', '3：布料振捣', '4：抹平压板', '5：养护', '6：质检修补'
]
# 3,    2,    3,    5,    3,    6                       6, 8, 1, 5, 3, 6
# 数据集 （类别 --> 类型 --> 每条生产线的生产时间）
MK01 = [
    [[6, 8, 1, 5, 3, 6], [9999, 9999, 4, 9999, 9999, 5], [1, 6, 3, 3, 6, 5], [9999, 6, 9999, 9999, 9999, 9999],
     [9999, 9999, 9999, 9999, 6, 3], [9999, 1, 2, 9999, 4, 9999]],  # 构件类别1
    [[3, 4, 9999, 2, 6, 1], [9999, 9999, 9999, 9999, 6, 3], [9999, 9999, 9999, 9999, 2, 9999],
     [9999, 4, 3, 9999, 9999, 9999], [9999, 1, 2, 9999, 4, 9999], [3, 2, 3, 5, 3, 6]],  # 构件类别2
    [[1, 6, 3, 3, 6, 5], [2, 4, 6, 6, 3, 6], [9999, 1, 2, 9999, 4, 9999], [4, 3, 5, 9999, 2, 3], [5, 4, 3, 1, 5, 3],
     [4, 9999, 6, 6, 3, 3]],
    [[4, 3, 5, 9999, 2, 3], [3, 4, 9999, 2, 6, 1], [9999, 6, 9999, 9999, 9999, 9999], [1, 6, 3, 3, 6, 5],
     [4, 3, 9999, 5, 4, 3], [5, 4, 3, 1, 5, 3]],
    [[2, 4, 6, 6, 3, 6], [4, 3, 9999, 5, 4, 3], [9999, 9999, 9999, 3, 9999, 9999], [4, 9999, 6, 6, 3, 3],
     [3, 4, 9999, 2, 6, 1], [9999, 4, 3, 9999, 9999, 9999]],
    [[4, 9999, 6, 6, 3, 3], [9999, 9999, 4, 9999, 9999, 5], [4, 3, 5, 9999, 2, 3], [2, 4, 6, 6, 3, 6],
     [9999, 6, 9999, 9999, 9999, 9999], [3, 4, 9999, 2, 6, 1]],
    [[5, 4, 3, 1, 5, 3], [9999, 9999, 9999, 9999, 2, 9999], [2, 4, 6, 6, 3, 6], [3, 2, 3, 5, 3, 6],
     [4, 9999, 6, 6, 3, 3]],
    [[9999, 4, 3, 9999, 9999, 9999], [4, 3, 5, 9999, 2, 3], [2, 4, 6, 6, 3, 6], [4, 9999, 6, 6, 3, 3],
     [4, 3, 9999, 5, 4, 3], [3, 4, 9999, 2, 6, 1]],
    [[9999, 6, 9999, 9999, 9999, 9999], [9999, 9999, 4, 9999, 9999, 5], [3, 4, 9999, 2, 6, 1], [4, 3, 9999, 5, 4, 3],
     [9999, 4, 3, 9999, 9999, 9999]],
    [[9999, 9999, 9999, 3, 9999, 9999], [2, 4, 6, 6, 3, 6], [4, 9999, 6, 6, 3, 3], [5, 4, 3, 1, 5, 3],
     [9999, 9999, 9999, 9999, 6, 3], [3, 4, 9999, 2, 6, 1]]
]
# 举例 3：  类别为：内墙   类型类：内墙型号1   在六条生产线的生产时间为：[3, 2, 3, 5, 3, 6]

# 数据集 （类别 --> 类型 --> 每条生产线的生产时间）
MK02 = [
    [[3, 9999, 2, 1, 4, 5], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1],
     [1, 1, 1, 1, 1, 1]],  # 构件类别1(不同类型构件，生产时间相同)
    [[2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2],
     [2, 2, 2, 2, 2, 2]],  # 构件类别2
    [[3, 3, 3, 3, 3, 3], [3, 3, 3, 3, 3, 3], [3, 3, 3, 3, 3, 3], [3, 3, 3, 3, 3, 3], [3, 3, 3, 3, 3, 3],
     [3, 3, 3, 3, 3, 3]],
]
# 数据集 （类别 --> 类型 --> 每条生产线的生产时间）
MK03 = [
    [[1, 2, 3, 1, 1, 1], [1, 2, 3, 1, 1, 1], [1, 2, 3, 1, 1, 1], [1, 2, 3, 1, 1, 1], [1, 2, 3, 1, 1, 1],
     [1, 2, 3, 1, 1, 1]],  # 构件类别1(不同类型构件，生产时间相同)
    [[4, 5, 6, 2, 2, 2], [4, 5, 6, 2, 2, 2], [4, 5, 6, 2, 2, 2], [4, 5, 6, 2, 2, 2], [4, 5, 6, 2, 2, 2],
     [4, 5, 6, 2, 2, 2]],  # 构件类别2
    [[7, 8, 9, 3, 3, 3], [7, 8, 9, 3, 3, 3], [7, 8, 9, 3, 3, 3], [7, 8, 9, 3, 3, 3], [7, 8, 9, 3, 3, 3],
     [7, 8, 9, 3, 3, 3]],
]

# （1）生产线：数量，种类          （ 六条生产线；         1#：楼梯生产线、2#外墙生产线、3#：混合生产线...  ）
# （2）构件类别 --> 构件型号      （ 类别：楼梯、楼外墙... ；      楼梯型号：楼梯1三个、楼梯2四个 ）
# （3）构件属性：工序，           （  ）
